<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 lists.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.1
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
include $root_path.'common.php';
$page_title = "Mailing Lists";
include $root_path.'page_header.php';

$s_domains = <<<EOFpacman
<cpanel Email="printdomainoptions()">
EOFpacman;


$big_wadge_of_stuff = <<<EOFpacman
<cpanel Email="listlists()">
EOFpacman;


$template->set_filenames(array(
	'body' => $root_path.$template_path.'mail/lists.tpl')
);

$lists_array = explode("<tr>", $big_wadge_of_stuff);

$i = 0;
foreach ($lists_array as $row)
{
	$temp = explode('<font size = "2">', $row);
	$temp2 = explode('</font>', $temp[1]);
	$email_address = $temp2[0];
	
	$underscore_address = str_replace("@", "_", $email_address);

	if (trim($email_address) != '') {
		$template->assign_block_vars('list_row', array(
			'ROWCLASS' => ($i%2) ? $template_cfg['class_row_1'] : $template_cfg['class_row_2'],
			'EMAIL_ADDRESS' => $email_address,
			'U_DELETE' => 'list_delete.php?email='.$email_address,
			'U_PASSWORD_CHANGE' => 'list_password.php?email='.$email_address,
			'U_MANAGE' => 'http://www.'.$domain.'/mailman/admin/'.$underscore_address,
		));
	$i++;
	};
};


$template->assign_vars(array(
	'S_NEW_LIST' => 'list_add_done.php',
	'S_DOMAINS' => $s_domains,
	'L_EMAIL_ADDRESS' => $lang['email_address'],
	'L_ACTIONS' => $lang['actions'],
	'L_CHANGE_PASSWORD' => $lang['change_password'],
	'L_MANAGE' => $lang['manage'],
	'L_LIST_NAME' => $lang['list_name'],
	'L_PASSWORD' => $lang['password'],
	'L_DOMAIN' => $lang['domain'],
	'L_CREATE_MAILING_LIST' => $lang['create_mailing_list'],
	'L_MAILMAN_DESCRIPTION_A' => $lang['mailman_description_a'],
	'L_MAILMAN_DESCRIPTION_B' => $lang['mailman_description_b'],
	'L_MAILING_LISTS' => $lang['mailing_lists'],
	'L_DELETE' => $lang['delete'],
	)
);


//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';




?>